<?php
/**
 * @desc 订单列表
 * @author kevin.wang
 * @date 2015-01-01 12:00:00
 */
class orderList extends CWidget
{
	public $pagePerNum = 5;
	public $currentPage = 1;
    public function init()
    {
    }
 
    public function run()
    {
		$userInfo = json_decode(Yii::app()->session['userinfo'], true);
		//获取订单列表
		$order = new Order;
		$orderList = $order->getOrderList($userInfo['user_id'], $this->currentPage, $this->pagePerNum);
		$count = array_pop($orderList);
		$count = $count['num'];
		$pageNum = ceil($count/$this->pagePerNum);
        $this->render('orderList', array("orderList" => $orderList,'pageNum'=>$pageNum, 'currentPage'=>$this->currentPage));
    }
}